<%@ Page Language="C#" MasterPageFile="~/Master.master" AutoEventWireup="true" CodeFile="AddNewUser.aspx.cs" Inherits="Admin_AddNewUser" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <h1>Add a new user</h1>
    
    <h2></h2>
    
    <div class="formInputTitle">Username:</div>
    <asp:TextBox runat="server" ID="txtUsername" CssClass="formInput" MaxLength="50" onfocus="this.className='formInputOver';" onblur="this.className='formInput';"></asp:TextBox>
    <span class="errorMessage"><asp:requiredfieldvalidator id="rfvUsername" runat="server" controltovalidate="txtUsername" validationgroup="createUser" errormessage="Please enter a username">*</asp:requiredfieldvalidator></span>
    
    <br /><br />
    
    <div class="formInputTitle">Password:</div>
    <asp:TextBox runat="server" ID="txtPassword" CssClass="formInput" MaxLength="50" onfocus="this.className='formInputOver';" onblur="this.className='formInput';"></asp:TextBox>
    <asp:requiredfieldvalidator id="rfvPassword" runat="server" controltovalidate="txtPassword" validationgroup="createUser" errormessage="Please enter a password">*</asp:requiredfieldvalidator>
    <span class="errorMessage"><asp:RegularExpressionValidator id="revPassword" runat="server" controltovalidate="txtPassword" validationgroup="createUser" errormessage="Password must be at least 6 characters long" ValidationExpression=".{6,20}">*</asp:RegularExpressionValidator></span>
    
    <br /><br />
     
    <div class="formInputTitle">E-mail:</div>
    <asp:TextBox runat="server" ID="txtEmail" CssClass="formInput" ReadOnly="false" onfocus="this.className='formInputOver';" onblur="this.className='formInput';"></asp:TextBox>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtEmail" ErrorMessage="*" SetFocusOnError="True" ValidationGroup="createUser"></asp:RequiredFieldValidator>
    <span class="errorMessage"><asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtEmail" ErrorMessage="Invalid e-mail address, or e-mail address already exists" SetFocusOnError="True" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ValidationGroup="createUser"></asp:RegularExpressionValidator></span>
    
    <br /><br />
    
    <div class="formInputTitle">Security question:</div>
    <asp:TextBox runat="server"  ID="txtSecureQ" CssClass="formInput" MaxLength="50" onfocus="this.className='formInputOver';" onblur="this.className='formInput';"></asp:TextBox> 
    <asp:requiredfieldvalidator id="rfvSecureQ" runat="server" controltovalidate="txtSecureQ" validationgroup="createUser" errormessage="Please enter a security question">*</asp:requiredfieldvalidator> 
    
    <br /><br />
    
    <div class="formInputTitle">Security answer:</div>
    <asp:TextBox runat="server"  ID="txtSecureA" CssClass="formInput" MaxLength="50" onfocus="this.className='formInputOver';" onblur="this.className='formInput';"></asp:TextBox> 
    <asp:requiredfieldvalidator id="rfvSecureA" runat="server" controltovalidate="txtSecureA" validationgroup="createUser" errormessage="Please enter a security question answer">*</asp:requiredfieldvalidator> 
   
    <br /><br />

    <h2>Please select which roles you want this user to be assigned to:</h2>
    
    <asp:CheckBoxList ID="cblRoles" runat="server" CssClass="checkBoxList"></asp:CheckBoxList>
    
    <p class="errorMessage"><asp:Label ID="lblRoles" runat="server" Text="Please select at least one role for this user to be assigned to" Visible="false"></asp:Label></p>

    <p><asp:Button ID="btnAddUser" runat="server" Text="Add new user" OnClick="btnAddUser_Click" ValidationGroup="createUser" /></p>

    <p class="errorMessage"><asp:Label ID="lblFailure" runat="server"></asp:Label></p>
    
    <asp:HiddenField ID="hfMgdAcc" runat="server" />
    
</asp:Content>
